package com.buka.recipe.common.result;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Result<T> {

    private Boolean success;

    private Integer code;

    private String message;

    private T data;

    public Result() {}

    public Result(Boolean success) {
        this.success = success;
        this.code = ResultCode.SUCCESS.code();
    }

    public Result(Boolean success, T data) {
        this.success = success;
        this.code = ResultCode.SUCCESS.code();
        this.data = data;
    }

    public Result(Boolean success, Integer code, String message, T data) {
        this.success = success;
        this.code = code;
        this.message = message;
        this.data = data;
    }

}
